% fun = @(x, y1, y2) [-1000.25 * y1 + 999.75 * y2 + 0.5; -1000.25 * y2 + 999.75 * y1 + 0.5];
% [xx,yy] = ode45(@(x,y) fun(x,y(1),y(2)) ,  [0,50],[1;-1]);
% fun = @(x, y1, y2) [-1000.25 * y1 + 999.75 * y2 + 0.5; -1000.25 * y2 + 999.75 * y1 + 0.5];
% 
% % 定义初始条件，注意将它们包含在一个向量中
% initCond = [1; -1];
% 
% % 定义时间跨度
% tspan = [0, 50];

% 调用求解器
% [t, Y] = ode45(@(x, y) fun(x, y(1), y(2)), tspan, initCond);
% fun =@(t,y,dy) [dy;0.01*dy.*dy + sin(t) - 2*y];
% 
% [t,x] = ode45(@(t,Y)fun(t,Y(1),Y(2)) ,[0,5],[0,1]);
% plot(t,x);
% fun = @(x,y) [-1000.25*y(1) + 999.75*y(2) +0.5;  999.75*y(1) -1000.25*y(2)  +0.5];
% [x,y] = ode45(fun,[0,50],[1;-1]);
% 
% 
% plot(xx,yy);
% x = [0:0.01:2*pi];
% y = [0:0.01:2*pi];
% 
% for i :

clear;clc;
% syms horn1 horn2
% tmp = sin(horn1 +horn2) - (sin(horn1)*cos(horn2) + sin(horn2)*cos(horn1) );
% simplify(tmp)
% % fprintf("%d",simple(tmp));
% syms x
% fun = x^4 -5*x^3 +5*x^2 +5*x - 6;
% 
% tmp = factor(fun);
% tmp
% syms a
% A = [1,2;2,a];
% 
% inv(A) 
% eig(A)

% syms x
% fun = (3 ^ x + 9 ^ x)^(1/x);
% ret = limit(fun,x,inf);
% 
% fprintf("%d",ret);
% clear; clc;
% 
% syms x y
% fun = (log(2*x + exp(-y))/log(10) / sqrt(x^2 + y^2));
% tmp = limit(fun,x,0,'left');
% ret = limit(tmp,y,0,'right');
% fprintf("%d",ret);



% clear;clc;
% syms k n x;
% % tmp = symsum(k,k,1,n);
% % tmp = symsum(k^2,k,1,n)
% % fun = (1/((2*n + 1)*(2*x + 1))) ^(2*n + 1);
% % tmp = symsum(fun,n,0,inf);
% % tmp = simplify(tmp)
% s3=symsum(1/(2*n+1)/(2*x+1)^(2*n+1),n,0,inf);s3=simplify(s3)

% syms x  y  z;
%  s = sin(x^2 *y *z);
% 
% s = diff(s,2);
% s = diff(s,1);
% s = subs(s,{x,y,z},{1,1,3});
% s
% syms x ;
% fun = exp(x);
% 
% 
% taylor(fun,x,8)


syms y;
fun = exp(2*y) / (exp(y) + 2);

simplify( int(fun,y) )












